#ifndef APPLICATION_H_
#define APPLICATION_H_

#include <map>
#include <string>

#include "glui.h"

class Application {
    public:
        void Init(int argc, char **argv);
        ~Application();
        
        static Application* getInstance(void);
        static void update(int controlID);
        const char* getString(int key);

        int m_renderWindow;
        GLUI* m_programWindow;

        // Live variables
        int m_geometry;
        int m_geometryType;

        // Controls
        GLUI_Listbox *c_geometry;
        GLUI_Checkbox *c_geometryType;

        // Utilities
        int m_mouseX;
        int m_mouseY;
        float m_cameraDistance;
        float m_cameraAngleX;
        float m_cameraAngleY;

        bool m_rotateAllowed;

    private:
        static Application* m_instance;

        // Map to store strings
        std::map<int, std::string> m_appStrings;

        Application() {}
        Application(const Application&) {}

};

enum controlIDs {
    C_START,
    C_GEOMETRY,
    C_GEOMETRYTYPE,
    C_MAX
};

enum geometry {
    G_START = C_MAX + 1,
    G_SPHERE,
    G_CUBE,
    G_CONE,
    G_TORUS,
    G_DODECAHEDRON,
    G_TETRAHEDRON,
    G_ISOCAHEDRON,
    G_OCTAHEDRON,
    G_TEAPOT,
    G_MAX
};

#define application Application::getInstance()

#define STRINGIFY(x) string(#x).substr(2)

#define SPECIFYAPPSTRING(x) m_appStrings[x] = STRINGIFY(x);

#endif
